﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Mathmall.Administration.Migrations
{
    /// <inheritdoc />
    public partial class ChangeAttrTable : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "AttrID",
                table: "AttrAttrgroupRelation",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "属性id",
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true,
                oldComment: "属性id");

            migrationBuilder.AlterColumn<int>(
                name: "AttrGroupID",
                table: "AttrAttrgroupRelation",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "属性分组id",
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true,
                oldComment: "属性分组id");

            migrationBuilder.AlterColumn<int>(
                name: "CatalogID",
                table: "Attr",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "所属分类",
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true,
                oldComment: "所属分类");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "AttrID",
                table: "AttrAttrgroupRelation",
                type: "int",
                nullable: true,
                comment: "属性id",
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "属性id");

            migrationBuilder.AlterColumn<int>(
                name: "AttrGroupID",
                table: "AttrAttrgroupRelation",
                type: "int",
                nullable: true,
                comment: "属性分组id",
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "属性分组id");

            migrationBuilder.AlterColumn<int>(
                name: "CatalogID",
                table: "Attr",
                type: "int",
                nullable: true,
                comment: "所属分类",
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "所属分类");
        }
    }
}
